/*题目：
 * 小明家有两个工厂，一个用于生产圆形积木，一个用于生产方形积木，请你帮他设计一个积木工厂系统，记录积木生产的信息。
 * 输入：输入的第一行是一个整数 N（1 ≤ N ≤ 100），表示生产的次数。
        接下来的 N 行，每行输入一个字符串和一个整数，字符串表示积木的类型。
        积木类型分为 "Circle" 和 "Square" 两种。整数表示该积木生产的数量
 * 输出：对于每个积木，输出一行字符串表示该积木的信息。
 * 示例：
 *      输入：3
            Circle 1
            Square 2
            Circle 1
        输出：Circle Block
            Square Block
            Square Block
            Circle Block
 * */

#include <iostream>
#include <vector>
using namespace std;
//抽象积木接口
class Block{
public:
    virtual void produce()=0;
};

//圆形积木
class CircleBlock:public Block{
public:
    void produce() override{
        cout<<"circle block"<<endl;
    }
};

//方形积木
class SquareBlock:public Block{
public:
    void produce() override{
        cout<<"square block"<<endl;
    }
};

//抽象积木工厂接口
class BlockFactory{
public:
    virtual Block* createBlock()=0;
};

//圆形积木工厂
class CircleBlockFactory:public BlockFactory{
public:
    Block* createBlock() override{
        return new CircleBlock();
    }

};

//方形积木工厂
class SquareBlockFactory:public BlockFactory{
public:
    Block* createBlock() override{
        return new SquareBlock();
    }
};

//积木工厂系统
class BlockFactorySystem{
private:
    vector<Block*> blocks;
public:
    void produceBlocks(BlockFactory * factory,int num){
        for (int i = 0; i < num; ++i) {
            Block* block=factory->createBlock();
            blocks.push_back(block);
            block->produce();
        }
    }

    const vector<Block*> getBlocks() const{
        return blocks;
    };
    ~BlockFactorySystem(){
        for (Block* block:blocks) {
            delete block;
        }
    }
};
int main(){
    BlockFactorySystem factorySystem;

    int proCount=0;
    cin>>proCount;

    for (int i = 0; i < proCount; ++i) {
        string blockType;
        int num;
        cin>>blockType>>num;

        if (blockType=="circle"){
            factorySystem.produceBlocks(new CircleBlockFactory(),num);
        }else if (blockType=="square"){
            factorySystem.produceBlocks(new SquareBlockFactory(),num);
        }

    }

    return 0;
}